package com.base.obj;

import java.net.URL;
import java.util.Enumeration;

/**
 * create by yongli on 2020-05-27 22:21
 */

public class LoadResource {
    public static void main(String[] args) {
        try {
            // 间隔符也不一样
            String clz2 = "com.liyong.con.log.LogTest2.class";
            String clz = "com/liyong/con/log/LogTest2.class";

            // getResource和getSystemResource的差别
            Enumeration<URL> urlEnum = LoadResource.class.getClassLoader().getResources(clz);


            while (urlEnum.hasMoreElements()) {
                URL url = urlEnum.nextElement();
                System.out.println(url);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
